package example.practice;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class EncodePassword {

    public static void main(String[] args) {
        String pwd = "123456";
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        String encode1 = encoder.encode(pwd);
        System.out.println(encode1);
        encoder = new BCryptPasswordEncoder();
        boolean matches = encoder.matches("123456", encode1);
        System.out.println(matches);
    }
}
